login()
function login(){
  let user = document.querySelector('input[type="text"]')
  let psd = document.querySelector('input[type="password"]')
  let btn = document.querySelector('button')

  let userMsg = String(localStorage.getItem('UNAME'))
  let psdMsg = String(localStorage.getItem("PWD"))
  
  btn.onclick = function(){
    if(user.value == userMsg && psd.value == psdMsg){
      alert('成功')
      window.location.href = '../index.html'
      window.event.returnValue = false
      localStorage.setItem("USERNAME",user.value)
    }else{
      alert('用户名或密码错误！')
    }
  }
  
}